<?php
/**
 * +----------------------------------------------------------------------
 * | 模型
 * +----------------------------------------------------------------------
 *                      _ooOoo_
 *                     o8888888o            | AUTHOR: 杜云
 *                     88" . "88            | EMAIL: 987772927@qq.com
 *                     (| -_- |)            | QQ: 987772927
 *                     O\  =  /O            | WECHAT: 987772927
 *                  ____/`---'\____
 *                .'  \\|     |//  `.
 *               /  \\|||  :  |||//  \
 *              /  _||||| -:- |||||-  \
 *              |   | \\\  -  /// |   |
 *              | \_|  ''\-/''  |   |
 *              \  .-\__  `-`  ___/-. /
 *            ___`. .'  /-.-\  `. . __
 *         ."" '<  `.___\_<|>_/___.'  >'"".
 *        | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 *        \  \ `-.   \_ __\ /__ _/   .-` /  /
 *   ======`-.____`-.___\_____/___.-`____.-'======
 *                      `=-='
 * +----------------------------------------------------------------------
 */
declare (strict_types=1);
namespace App\Model;

use Hyperf\Database\Model\SoftDeletes;
/**
 * @property int $id 节点ID
 * @property string $cate_id 分组
 * @property string $description 描述
 * @property string $title 标题
 * @property string $thumb banner图
 * @property string $url 跳转路径
 * @property int $sort 排序
 * @property int $status 状态
 * @property string $remark 备注
 * @property \Carbon\Carbon $created_at 操作时间
 * @property \Carbon\Carbon $updated_at 更新时间
 * @property int $created_user 操作人
 * @property string $deleted_at 软删除
 */
class Advert extends BaseModel
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'adverts';
    protected $hidden = ['deleted_at'];
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['id', 'cate_id', 'title', 'target','thumb', 'url', 'sort', 'status', 'remark', 'created_at', 'updated_at', 'created_user', 'deleted_at'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'sort' => 'integer','target' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'created_user' => 'integer'];
    /**
     * [createuser 创建者]
     * @return [type] [description]
     */
    public function createuser()
    {
        return $this->hasOne(User::class, 'id', 'created_user');
    }
}